package com.itheima.utils;

/**
 * @author: zhengsuyang
 * @Desc:
 * @create: 2025-09-14 18:09
 **/

public class CurrentHolder {
    private static ThreadLocal<Integer> threadLocal = new ThreadLocal<>();
    public static Integer getUserId() {
        return threadLocal.get();
    }

    public static void setUserId(Integer userId) {
        threadLocal.set(userId);
    }


    public static void removeUserId() {
        threadLocal.remove();
    }
}
